package cn.chen.数据结构.二叉树.线索二叉树;

public class ThreadedBinaryTreeTest {

    public static void main(String[] args){

        ThreadedBinaryTree tree=new ThreadedBinaryTree();

        ThreadedTreeNode chen1 = new ThreadedTreeNode(1, "chen1");
        ThreadedTreeNode chen3 = new ThreadedTreeNode(3, "chen3");
        ThreadedTreeNode chen6 = new ThreadedTreeNode(6, "chen6");
        ThreadedTreeNode chen8 = new ThreadedTreeNode(8, "chen8");
        ThreadedTreeNode chen10 = new ThreadedTreeNode(10, "chen10");
        ThreadedTreeNode chen14 = new ThreadedTreeNode(14, "chen14");

        tree.setRoot(chen1);
        chen1.leftNode=chen3;
        chen1.rightNode=chen6;
        chen3.leftNode=chen8;
        chen3.rightNode=chen10;
        chen6.leftNode=chen14;

        // 线索化
//        tree.midClueing();
//        tree.preClueing();
        tree.postClueing();
        System.out.println(chen10.rightNode);
        System.out.println(chen10.leftNode);


        // 中序遍历线索二叉树
//        tree.midOrder2();

    }
}
